package neo4j.entity;

import com.google.gson.Gson;
import deepr.anno.Property;
import deepr.anno.Schema;
import deepr.anno.SchemaType;
import deepr.anno.Type;
import deepr.handler.DistanceHandler;
import deepr.handler.SnowIdHandler;
import lombok.Data;

@Data
@Schema(name = "User", type = SchemaType.NEO4J)
public class User {
    @Property(primaryKey = true, desc = "唯一id", handler = SnowIdHandler.class)
    private Integer id;
    @Property
    private String userName;
    private String projectId;

    @Property(type = Type.JsonArray)
    private Gson label;

    @Property(type = Type.JSON)
    private Gson creater;

    @Property
    private String phone;


    @Property
    private Float lat;
    @Property
    private Float lon;

    @Property
    private String project;

    @Property(name = "device", schema = Device.class, type = Type.OneToMany, relationLabel = "Direct", relation = Direct.class)
    private Device device;


    @Property(handler = DistanceHandler.class, handlerArgs = {"lat", "lon"})
    private Float distance;

}
